package cn.genmer.test.security.thread.threadcoreknowledge.startthread;

/**
 * @program: concurrency_practice
 * @description: 对比start和run两种启动线程的方式
 * @author: Genmer
 * @create: 2020-10-16 13:45
 **/
public class StartAndRunMethod {
    public static void main(String[] args) {
        Runnable runnable = () -> {
            System.out.println(Thread.currentThread().getName());
        };
        //直接执行run方法
        runnable.run();
        //创建线程，传递runnable
        new Thread(runnable).start();


        Thread thread = new Thread();
        thread.run();
    }
}
